// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取数据字典类别 GET /api/data-dictionary/categorys */
export async function getApiDataDictionaryCategorys(options?: { [key: string]: any }) {
  return request<API.SimpleResultListDataDictionaryCategoryDto>('/api/data-dictionary/categorys', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 数据字典分页查询 POST /api/data-dictionary/${param0}/${param1}/paged-list */
export async function postApiDataDictionaryByIndexByLimitPagedList(
  params: {
    // query
    /** 开始时间 */
    StartTime?: string;
    /** 结束时间 */
    EndTime?: string;
    /** 关键字查询 */
    Keyword?: string;
    /** 类别Id */
    CategoryId?: string;
    // path
    index: number;
    limit: number;
  },
  body: API.DataDictionarySort,
  options?: { [key: string]: any },
) {
  const { index: param0, limit: param1, ...queryParams } = params;
  return request<API.SimpleResultPagingListDataDictionaryDto>(
    `/api/data-dictionary/${param0}/${param1}/paged-list`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      params: {
        ...queryParams,
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获取数据字典详情 GET /api/data-dictionary/detail/${param0} */
export async function getApiDataDictionaryDetailByKey(
  params: {
    // path
    key: string;
  },
  options?: { [key: string]: any },
) {
  const { key: param0, ...queryParams } = params;
  return request<API.SimpleResultDataDictionaryDetailDto>(`/api/data-dictionary/detail/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取数据类别字典详情 GET /api/data-dictionary/category-detail/${param0} */
export async function getApiDataDictionaryCategoryDetailById(
  params: {
    // path
    id: string;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.SimpleResultDataDictionaryCategoryDetailDto>(
    `/api/data-dictionary/category-detail/${param0}`,
    {
      method: 'GET',
      params: { ...queryParams },
      ...(options || {}),
    },
  );
}

/** 创建类别 POST /api/data-dictionary/category */
export async function postApiDataDictionaryCategory(
  body: API.InputDataDictionaryCategoryDto,
  options?: { [key: string]: any },
) {
  return request<any>('/api/data-dictionary/category', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 创建数据字典项 POST /api/data-dictionary */
export async function postApiDataDictionary(
  body: API.CreateDataDictionaryDto,
  options?: { [key: string]: any },
) {
  return request<any>('/api/data-dictionary', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除一个或多个字典项 DELETE /api/data-dictionary */
export async function deleteApiDataDictionary(body: string[], options?: { [key: string]: any }) {
  return request<any>('/api/data-dictionary', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新字典类别 PUT /api/data-dictionary/${param0}/category */
export async function putApiDataDictionaryByIdCategory(
  params: {
    // path
    id: string;
  },
  body: API.InputDataDictionaryCategoryDto,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<any>(`/api/data-dictionary/${param0}/category`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 删除字典类别 DELETE /api/data-dictionary/${param0}/category */
export async function deleteApiDataDictionaryByIdCategory(
  params: {
    // path
    id: string;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<any>(`/api/data-dictionary/${param0}/category`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新字典项数据 PUT /api/data-dictionary/${param0} */
export async function putApiDataDictionaryByKey(
  params: {
    // path
    key: string;
  },
  body: API.UpdateDataDictionaryDto,
  options?: { [key: string]: any },
) {
  const { key: param0, ...queryParams } = params;
  return request<any>(`/api/data-dictionary/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}
